<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2021/11/3
  Time: 18:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
    <script>
        function u() {
            $.post({
                url:"${pageContext.request.contextPath}/admin/uInfo",
                data:{'username':$("#username").val()},
                success:function (data) {
                    if (data.toString()=='true'){
                        $("#usernameInfo").css("color","green");
                        $("#usernameInfo").html("√");
                    }else {
                        $("#usernameInfo").css("color", "red");
                        $("#usernameInfo").html("x");
                    }
                }
            });
        }
    </script>
</head>
<body>
<form action="${pageContext.request.contextPath}/admin/login" method="post">
    用户名：<input type="text" name="username" id="username" onblur="u()"/><span id="usernameInfo"></span><br>
    密码：<input type="password" name="password" id="password"/><span id="passwordInfo"></span><br>
    <input type="submit" value="登录"/>
    <input type="reset" value="取消"/>
</form>

</body>
</html>
